//
// Created by Tony on 2024/5/24.
//

#ifndef PARSER_BLOCK_STMT_H
#define PARSER_BLOCK_STMT_H

#include "../../../../compiler/SymbolTable.h"
#include "../../AstList.h"

namespace Parser {

class BlockStmt final : public AstList {
    string nodeName;
    shared_ptr<Compiler::SymbolTable> symbolTable;

public:
    explicit BlockStmt(const vector<shared_ptr<Ast>>& children) : AstList(children) {
        nodeName = __func__;
    }

    shared_ptr<Compiler::SymbolTable> getSymbolTable() const { return symbolTable; }

    void setSymbolTable(const shared_ptr<Compiler::SymbolTable>& table) {
        this->symbolTable = table;
    }

    int32_t accept(Compiler::Visitor* visitor) override;
};

} // namespace Parser

#endif // PARSER_BLOCK_STMT_H
